[branch-0.9] Cherry pick feat(datafusion): expose PartitionKeysKind getter on IcebergTableScan#21
Merged
Merged
Conversation
notfilippo
approved these changes
May 19, 2026
1ce2eb9 to
35741b7
Compare
Add `PartitionKeysKind` (#[non_exhaustive] enum: Identity | Bucket) and a public `partition_keys_kind() -> Option<PartitionKeysKind>` getter on `IcebergTableScan`, so callers can distinguish identity-backed from bucket-backed `Partitioning::Hash` without re-inspecting table metadata. Wired through `IcebergTableProvider::scan` via a crate-internal `with_partition_keys_kind` setter; public constructor signatures are unchanged. Existing bucket/identity tests extended with `partition_keys_kind()` assertions. (cherry picked from commit 28d117f)
35741b7 to
02ac860
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry pick 35741b7
Jira https://datadoghq.atlassian.net/browse/QECO-1260
Which issue does this PR close?
What changes are included in this PR?
Expose to callers which transform family produced an
IcebergTableScan'sPartitioning::Hashdeclaration. Today the scan's partitioning surface is opaque:properties().partitioningonly carries theColumnexprs, so any consumer that needs to branch on "thisHashis identity-backed vs. bucket-backed" has to re-walk the table metadata and re-run the detection logic frombucketing.Public, re-exported from
crate::table:Nonemeans the scan declaresUnknownPartitioning. Wiring goes through a crate-internalwith_partition_keys_kindbuilder setter onIcebergTableScan, called byIcebergTableProvider::scanright afterPartitioning::Hashis chosen. Public constructors (IcebergTableScan::new,new_with_tasks) are unchanged.PartitionKeysKindis derived viaPartitionKeys::kind(), i.e. from the same descriptor that drives both task bucketing and theHashexpression list, so kind andPartitioning::Hashcannot drift.#[non_exhaustive]. Future transform families (e.g. truncate, mixed) can be added without breaking downstreammatches.new_with_taskssignature and keeps the field private.Are these changes tested?
Existing identity and bucket tests in
table/mod.rsextended withpartition_keys_kind()assertions on both theHashandUnknownPartitioningpaths.